window: Only claim the sequence if keeping the grab
authorCarlos Garnacho <carlosg@gnome.org>
Sun, 25 Jan 2015 17:55:01 +0000 (17:55 +0000)
committerCarlos Garnacho <carlosg@gnome.org>
Wed, 28 Jan 2015 17:11:12 +0000 (17:11 +0000)
If the grab belongs elsewhere, the window won't claim the sequence right
away. The sequence may still be claimed afterwards when window dragging
starts, but simple clicks won't be consumed this way.

This makes it possible to close popovers when clicking on the title region,
while still permitting touch/button 1 interaction for every other purpose.

https://bugzilla.gnome.org/show_bug.cgi?id=743257

gtk/gtkwindow.c

index 0fc90293e837829edb0f570fd096d7e9207602f0..241f8ede21fce209a6190835b102c9cfb0359fd9 100644 (file)
@@ -1476,8 +1476,9 @@ multipress_gesture_pressed_cb (GtkGestureMultiPress *gesture,
       if (n_press == 1)
         priv->drag_possible = TRUE;
 
-      gtk_gesture_set_sequence_state (GTK_GESTURE (gesture),
-                                      sequence, GTK_EVENT_SEQUENCE_CLAIMED);
+      if (gtk_widget_has_grab (widget))
+        gtk_gesture_set_sequence_state (GTK_GESTURE (gesture),
+                                        sequence, GTK_EVENT_SEQUENCE_CLAIMED);
       break;
     default:
       if (!priv->maximized)